<admintpl file="header" />
<style>
    .table
    {
        table-layout: fixed;
        width: 100%;
    }
    .table td
    {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
</style>
</head>
<body style="min-width: 800px;">
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>评论列表</a></li>
        <li><a href="{:U('Question/AdminQuestion/question_answer_list', array('post_id' => $post_id))}">回答列表</a></li>
        <li class=""><a href="{:U('Question/AdminQuestion/invite_professor', array('post_id' => $post_id))}">邀请专栏作者</a></li>
    </ul>
    <table class="table table-hover table-bordered table-list">
        <thead>
        <tr>
            <th width="50">ID</th>
            <th width="100">昵称</th>
            <th>评论内容</th>
            <th width="120">状态</th>
            <th width="120">时间</th>
            <th width="150">操作</th>
        </tr>
        </thead>
        <php>$status = array('0' => '待审核', '1' => '正常', '2' => '已删除');</php>
        <foreach name="comment_list" item="vo">
            <tr>
                <td>{$vo.id}</td>
                <td>{$vo.full_name}</td>
                <td onclick="show_comment('{$vo.content}')">{$vo.content}</td>
                <td>{$status[$vo['status']]}</td>
                <td>{$vo.createtime}</td>
                <td>
                    <a href="{:U('Commentadmin/delete', array('id' => $vo['id']))}" class="js-ajax-delete">删除</a>
                </td>
            </tr>
        </foreach>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    function show_comment(comment) {
        art.dialog({id:"comment_dialog"}).close();
        comment = "<div style='width: 300px; height: 200px;'>" + comment + "</div>"
        Wind.use("artDialog", function() {
            art.dialog({
                id : "comment_dialog",
                fixed: true,
                title : "评论详情",
                content : comment,
            });
        });
    }
</script>
</body>
</html>